<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>

<title>Getting Started - phoneME Feature Software (MR4)</title>
    <link rel="stylesheet" href="./style/document.css" type="text/css">

<!--
<style type="text/css"> /* <![CDATA[ */
@import "/branding/css/tigris.css";
@import "/branding/css/inst.css";
/* ]]> */</style>
<link rel="stylesheet" type="text/css" href="/branding/css/print.css" media="print" />
<script src="/branding/scripts/tigris.js" type="text/javascript"></script>

<script src="/branding/scripts/alm.js" type="text/javascript"></script>
<style type="text/css">
/* <![CDATA[ */
@import "/brinding/css/alm.css";
/* ]]> */
</style>
-->

<!--
<title>Getting Started - phoneME Feature Software (MR4)</title>
<link rel="stylesheet" href="./style/tigris.css" type="text/css">
<link rel="stylesheet" href="./style/inst.css" type="text/css">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="version" content="4.5.2.148.4" />

<style type="text/css"></style>
-->

</head>

<body  class="composite">
<div class="strut">&nbsp;</div>
</td>
<td id="midcol">
<div id="bodycol">

<!--  ================= BEGIN PAGE BODY (Ignore Everything Above)  ============ -->

<!-- Header -->
<table class="full-width">
  <tr>
    <td align="center" class=sun-darkblue>
      <h1>Getting Started</h1>
      <h2>phoneME&#153; Feature Software (MR4)</h2>
      <h4>April 2009</h4>
    </td>
  </tr>
  <tr>
    <td class=sun-lightblue>&nbsp;</td>
  </tr>
</table>
<p>
<!-- End Header -->

<!-- BEGIN PAGE TITLE -->
<div id="projecthome" class="app"> <h2><font color="#225577">Building a CLDC
Reference Port<span class="style1"></span></font></h2>
<!-- END PAGE TITLE -->

<p>
<a href="../index.html">home</a> | <a href="./index_feature.html">first</a> | 
<a href="./pcsl_feature.html">prev</a> | <a href="./client_feature.html">next-last</a> 
<p>

CLDC software is the OSS community version of Sun Microsystems' Connected Limited 
Device Configuration HotSpot&#153; Implementation virtual machine.
<P>
This document has the following sections:
<p>
<ul>
<li><a href="#win32">Building CLDC Software on a Windows x86 Build Platform</a></li>
<li><a href="#build_docs">Building CLDC Documentation</a></li>
</ul>
<p> 
For more information about building and running CLDC, see 
<a href="http://java.sun.com/javame/reference/docs/cldc-hi/index.html">
CLDC HotSpot Implementation software documentation</a>.
<p>


<!-- BEGIN SECTION HEAD -->
<hr noshade="noshade" size="1">
<a name="win32"></a><h3>Building CLDC Software on a Windows x86 Build Platform</h3>
<!-- END SECTION HEAD -->
<p>
Building a default version of CLDC creates the CLDC software executable <code>cldc_vm.exe</code> 
for the JavaCall porting layer on a Windows x86 target platform. To properly build the CLDC software on 
a Windows x86 build platform, you must set the environment variables shown in 
<a href="#table4-1">TABLE 4-1</A>. 
<P>

<a name="table4-1"></a>
<TABLE CLASS="Titled" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000"
CELLPADDING=5 CELLSPACING=0 >
<CAPTION><b>TABLE 4-1</b> Required CLDC Build Variables for Windows x86</CAPTION>
<THEAD>
<TR>
<TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC">
<P CLASS="TableHead"><A NAME="pgfId-473082"></A>Name
</P>
</TH>
<TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC">
<P CLASS="TableHead"><A NAME="pgfId-473084"></A>Description
</P>
</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<code>JVMWorkSpace</code>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText">The location of your CLDC software source code workspace.  For example,
<code>JVMWorkSpace=%COMPONENTS_DIR%/cldc</code>.
<br>
</P>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText"><code>JVMBuildSpace</code>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText">The location of your CLDC software build output. For example,
<code>JVMBuildSpace=%BUILD_OUTPUT_DIR%/cldc</code>.
</P>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText"><code>ENABLE_PCSL</code>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText">Required for building CLDC with the PCSL software component. Must 
be set to <code>true</code>.
</P>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<code>PCSL_OUTPUT_DIR</code>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText">The location of PCSL build output.  Required for building CLDC 
if <code>ENABLE_PCSL=true</code>.  For example, 
<code>PCSL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/pcsl</code>.
</P>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText"><code>ENABLE_ISOLATES</code>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="TableText">Required for building a CLDC implementation with multitasking 
capability. Must be set to <code>true</code>.  If not explicitly set to <code>true</code>, 
the build defaults to <code>false</code> and CLDC is built without multitasking capability.
<p>
<b>Note:</b> If you set <code>ENABLE_ISOLATES=true</code> to build a CLDC implementation
with multitasking capability, you must also set <code>USE_MULTIPLE_ISOLATES=true</code>
to build the phoneME Feature software, as described in <a href="./client_feature.html">
Building a phoneME Feature Reference Port</a>.
<p>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>JAVACALL_OUTPUT_DIR</code> <P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
The location of JavaCall porting layer output. For example, 
<code>JAVACALL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/javacall</code>.
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>TOOLS_DIR</code>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
Defines the directory where needed build tools are located.  For example,
<code>TOOLS_DIR=%COMPONENTS_DIR%/tools</code>.
<p>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>TOOLS_OUTPUT_DIR</name>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
Defines a directory location for tools-specific output.  For example,
<code>TOOLS_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/tools</code>.
<p>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>USE_VS2005</code>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
Tells the build system to use Microsoft Visual Studio 2005 as the default compiler
setting, as shown here: <code>USE_VS2005=true</code>.
<p>
<b>Note:</b> If Microsoft Visual Studio 2005 is your default compiler, you do not
need to set this variable. <code>USE_VS2005=true</code> is set for you in the MR4
build scripts. However, if you are using some other compiler (which is possible,
but not supported, in MR4), you <i>must</i> set this variable to
<code>USE_VS2005=false</code>.
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>ENABLE_JAVA_DEBUGGER</code>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
Supports the use of the emulator binary plugin.  For example,
<code>ENABLE_JAVA_DEBUGGER=true</code>.
<p>
</TD>
</TR>
<TR>
<TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1">
<P>
<code>ENABLE_MULTIPLE_PROFILES_SUPPORT</code>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P>
Supports the use of the emulator binary plugin.  For example,
<code>ENABLE_MULTIPLE_PROFILES_SUPPORT=true</code>.
<p>
</TD>
</TR>
</TBODY>
</TABLE>
<p>


<a name="build_win"></a>
<strong>Building CLDC for a Windows x86 Target Platform</strong>
<P>
<ol>
<b><li>Set the</b> <code>JVMWorkSpace</code> <b>variable, as shown here.</b>
<p>
<code>C:\> set JVMWorkSpace=%COMPONENTS_DIR%/cldc</code>
<p>
<b><li>Set the</b> <code>JVMBuildSpace</code> <b>variable, as shown here.</b>
<p>
<code>C:\> set JVMBuildSpace=%BUILD_OUTPUT_DIR%/cldc</code>
<p>
<b><li>Run the</b> <code>make</code> <b>command as a single command-line string, as shown here.</b>
<P>
<code>C:\> make -C %JVMWorkSpace%/build/javacall_i386_vc  ENABLE_PCSL=true 
PCSL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/pcsl ENABLE_ISOLATES=true 
JAVACALL_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/javacall TOOLS_DIR=%COMPONENTS_DIR%/tools 
TOOLS_OUTPUT_DIR=%BUILD_OUTPUT_DIR%/tools ENABLE_JAVA_DEBUGGER=true 
ENABLE_MULTIPLE_PROFILES_SUPPORT=true</code>
</ol>
<P>
The generated CLDC output is found under <code>%JVMBuildSpace%/javacall_i386_vc/dist</code>.
</OL>
<p>


<!-- BEGIN SECTION HEAD -->
<hr noshade="noshade" size="1">
<a name="running"></a><h3>Running CLDC Software</h3>
<!-- END SECTION HEAD -->

<p>
Once you build the CLDC software, you can invoke it from the command line
to run a class compiled from the Java programming language. The path to the
executable depends on the target platform (operating system and processor) for
which you build the software.
<P>

<a name="run_win"></a>
<strong>Running CLDC on a JavaCall porting layer on Windows x86 Target Platform</strong>
<p>
<ol>
<b><li>Change to the CLDC build space for the JavaCall porting layer on Windows x86 platform:</b>
<P>
<code>C:\> cd %JVMBuildSpace%/javacall_i386_vc/dist</code>
<p>
<b><li>Enter the following command:</b>
<P>
<code>C:\> bin/cldc_vm.exe -classpath</code>
<EM>location-of-compiled-applications</EM><code>/classes</code> <EM>classname</EM>
<p>
For example, to run the <code>HelloWorld</code> application:
<p>
<code>C:\> bin/cldc_vm -classpath C:/src/classes HelloWorld</code>
</ol>
<p>


<!-- BEGIN SECTION HEAD -->
<hr noshade="noshade" size="1">
<a name="build_docs"></a><h3>Building CLDC Documentation</h3>
<!-- END SECTION HEAD -->
<p>

You can create HTML documents from CLDC porting interfaces. To do this for the
CLDC software, use the <code>make docs_html</code> build target.
<P>

<a name="javadoc"></a>
<strong>Generating Javadoc Tool Documentation</strong>
<P>
Building Javadoc&#153 tool documentation is the same for all build platforms.
<P>
<ol>
<b><li>Change to the default build directory for your build platform.</b> 
<p>
For example, this could be a Linux on i386 platform, as shown here.
<P>
<code>C:\> cd %JVMWorkSpace%/build/linux_i386</code>
<P>
<b><li>Build Javadoc tool HTML documentation.</b>
<P>
<code>C:\> make docs_html</code>
<P>
</ol>
<p>

<a name="view_javadoc"></a>
<strong>Viewing phoneME Feature Documents</strong>
<P>
Use any browser to display the Javadoc tool output file at the following URL:
<P>
<ul>
<code>file://%JVMBuildSpace%/doc/javadoc/html/index.html</code>
</ul>
<pre>


</pre>

<a href="../index.html">home</a> | <a href="./index_feature.html">first</a> | 
<a href="./pcsl_feature.html">prev</a> | <a href="./client_feature.html">next-last</a> 
<p>

<!-- =================================== END PAGE BODY ================== -->

<hr shade="noshade" size="1">

<p class="copyright"><a href="./style/copyright.html">Copyright</a>
&#169; 2009 Sun Microsystems, Inc. All rights reserved. 
</p>

</div></td></tr></tbody></table></body></html>
